#ifndef PROJECTZ_NUSER_NCOMMAND_DUNGEON_GET_GOLD_H_
#define PROJECTZ_NUSER_NCOMMAND_DUNGEON_GET_GOLD_H_

#include "../../engine.h"

#include "../../User.h"

#include "../../NLogic/Static.h"
#include "../../NLogic/Battle.h"

namespace ProjectZ { namespace NCommand { namespace NMatching {

class CS_DUNGEON_GET_GOLD
{
public:
	static void OnExecute(User * pUser, ::Network::Packet * pPacket)
	{
		/*
		 * /// 던젼 골드 획드 C -> S
		CS_DUNGEON_GET_GOLD		0x0824
		{
			u16	u16get_gold;		/// 골드획득량
		}

		/// 던젼 골드 획드  S -> C
		SC_DUNGEON_GET_GOLD		0x0825
		{
			u32	u32cur_gold;		/// 현재골드량
		}
		 */
		NLogic::Space * pSpace = pUser->GetSpace();
		if (NULL == pSpace)
		{
			DEBUGLOG("CS_DUNGEON_GET_GOLD NULL == pSpace");
			return;
		}

		if (false == pSpace->IsDungeon())
		{
			DEBUGLOG("CS_DUNGEON_GET_GOLD TYPE IS NOT DUNGEON");
			return;
		}


		PREPARE_PACKET;

		uint16_t gold = 0;
		* pPacket >> gold;

		pUser->GetBattle()->GetData().get_gold += gold;

		::Network::Packet * pAck = ::Network::GETPACKETPOOL()->SEND_NEW();
		* pAck << pUser->GetBattle()->GetData().get_gold;
		pAck->MakePacket(CMD_SC_DUNGEON_GET_GOLD);
		pUser->Send(pAck);
	}
};

} /*NBattle*/ } /*NCommand*/ } /*ProjectZ*/

#endif /* PROJECTZ_NUSER_NCOMMAND_DUNGEON_GET_GOLD_H_ */
